#include<iostream>
using namespace std;
const int SIZE = 1005;
void dfs(int e[][SIZE],int N, int miss);
void recur(int e[][SIZE], int N, int cur, int visited[]);

int main(int argc, char const *argv[])
{
    freopen("test.txt","r",stdin);
    int N,M,K;
    scanf("%d%d%d",&N,&M,&K);
    int e[SIZE][SIZE]{0}; 
    for(int _ = 0;_<M;++_)
    {
        int i,j; scanf("%d%d",&i,&j); i--;j--;
        e[i][j]=e[j][i]=1;
    }
    for(int i = 0;i<K;++i)
    {
        int miss; scanf("%d",&miss); miss--;
        dfs(e,N,miss);
    }
    return 0;
}

void dfs(int e[][SIZE],int N, int miss)
{
    int cnt=0;
    int visited[SIZE]{0}; visited[miss] = 1;
    for(int i = 0;i<N;++i)
    {
        if(!visited[i])
        {
            cnt++;
            recur(e,N,i,visited);
        }
    }
    printf("%d\n",cnt-1);
}
void recur(int e[][SIZE], int N, int cur, int visited[])
{
    visited[cur] = 1;
    for(int i = 0;i<N;++i)
    {
        if(!visited[i] && e[cur][i])
        {
            recur(e,N,i,visited);
        }
    }
}